<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>{$title}{if $pluginTitle} - {$pluginTitle}{/if}</title>
        {if $pluginCSS}<link href="{$site_url}/plugins/{$pluginCSS}" rel="stylesheet" type="text/css" />{/if}
        <link href="{$site_url}/templates/{$theme}/style.css" rel="stylesheet" type="text/css" />
        <script src="{$site_url}/includes/javascript/number-functions.js"></script>
        <script src="{$site_url}/includes/javascript/parseuri.js"></script>

        {literal}
        <script type="text/javascript">
            function setCurrent(type, id) {
                var url = parseUri(window.location);
                if (url.port && (url.port != 80)) {
                    url.host += ':' + url.port;
                }
                var newUrl = url.protocol + '://' + url.host + url.path + '?';

                for (i in url.queryKey) {
                    if ((i != 'setacc') && (i != 'setchar')) {
                        newUrl += i + '=' + url.queryKey[i] + '&';
                    }
                }

                newUrl += type + '=' + id;

                window.location = newUrl;
            }

            function showInfo(typeId) {
                {/literal}
                window.open("{$site_url}/?module=showinfo&popup=1&typeId="+typeId, "type"+typeId, "location=0,status=0,scrollbars=1,width=450,height=550");
                {literal}
            }

            function toggleErrors() {
                var errPop = document.getElementById('errorPopup');
                if (errPop.style.display == 'none') {
                    errPop.style.display = '';
                } else {
                    errPop.style.display = 'none';
                }
            }
        </script>
        {/literal}

    </head>

    <body>

        <div id="header">
            <div style="float: left;">
                <a href="{$site_url}/"><img src="{$site_url}/templates/{$theme}/images/title.png" border="0" /></a>
            </div>
            {if $accounts}
            {strip}
            <div class="charSelect">
                <div class="selects">
                    <select id="accountSelect" onchange="setCurrent('setacc', this.value)">
                        {foreach from=$accounts item=acc}
                        <option value="{$acc.row.id}" {if $curacc == $acc.row.id}selected="true"{/if}>{$acc.row.name}</option>
                        {/foreach}
                    </select><br />
                    <select id="characterSelect" onchange="setCurrent('setchar', this.value)">
                        {foreach from=$characters item=char}
                        <option value="{$char.characterID}" {if $curchar == $char.characterID}selected="true"{/if}>{$char.name}</option>
                        {/foreach}
                    </select>
                </div>
                <div class="chars">
                    <div>
                        {foreach from=$characters item=char}
                        <a href="#" title="{$char.name}" onclick="setCurrent('setchar', '{$char.characterID}')"><img src="http://image.eveonline.com/Character/{$char.characterID}_64.jpg" /></a>
                        {/foreach}
                    </div>
                </div>
            </div>
            {/strip}
            {/if}
        </div>

        <div id="container">

            <div id="navigation">
		{foreach item=block from=$sideBlocks}
                {include file="sideblock_left.html" title=$block.title content=$block.content}
                {/foreach}
            </div>

            <div id="main">
		{$content}
            </div>

            <div id="footer-wrapper">
                <div id="footer" align="right"><a href="http://outofeve.com/">Out of Eve</a> <a href="http://shrimpworks.za.net/"><img src="{$site_url}/templates/{$theme}/images/shrimpworks.png" border="0" style="position:relative; top: 3px;" /> ShrimpWorks</a></div>
            </div>

        </div>

        {if $errors}
        <div id="errorPopup" style="display: block;">
            <h3><img src="{$site_url}/templates/{$theme}/images/error.png" border="0" align="absmiddle" /> Encountered the following error(s):</h3>
            {foreach item=error from=$errors}
            <div class="apierror">{$error}</div>
            {/foreach}
            <div align="right"><a href="#" onclick="toggleErrors(); return false;">[ Close ]</a></div>
        </div>
        {/if}

    </body>

</html>
